package gjbsh.bangong.ds.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import gjbsh.bangong.ds.service.单位类型Service;
import gjbsh.support.JsonResult;

/**
 * @author yaolongjun
 * @date   2020年5月12日 下午2:58:38
 */
@RestController
@RequestMapping("danweileixing")
public class 单位类型Controller {
	
	private Logger logger = LoggerFactory.getLogger(getClass());
	
	@Autowired
	单位类型Service ddService;
	
	/**
	 * @author yaolongjun
	 * @description	根据单位ID查询下级单位的单位类型   
	 */
	@RequestMapping("find_xjdwleixing_by_deptid")
	public JsonResult<?> find_xjdwleixing_by_deptid(@RequestParam("deptid")String ppDeptId){
		try {
			if("".equals(ppDeptId)) {
				return JsonResult.getErrorResult("单位ID不能为空");
			}
			return JsonResult.getSuccessResult(ddService.findXjdwleixingByDeptId(ppDeptId));
		} catch (Exception e) {
			logger.error("单位类型Controller->find_xjdwleixing_by_deptid: "+e.getMessage());
			return JsonResult.getErrorResult("根据单位id查询下级单位类型失败");
		}
	}
	
	
	
	
	
	

}
